﻿using System;

namespace ConsoleApplication1
{
    class Leaf : MyNode
    {
        public override MyNode[] Childs
        {
            get { return new MyNode[] { }; }
            set
            {
                throw new Exception("leaf can't have childs");
            }
        }
        public String Value { get; private set; }

        public Leaf(string name, string value)
            : base(name)
        {
            Name = name;
            Value = value;
        }
        public override string Accept(XMLNodeVisitor visitor)
        {
            return visitor.VisitLeaf(this);
        }
    }
}